用Nginx解决页面无法被Iframe | 您所在的位置:网站首页 › nginx 去掉header › 用Nginx解决页面无法被Iframe |
location /www.xxx.com { proxy_pass http://www.xxx.com/; proxy_hide_header "X-Frame-Options"; proxy_set_header Accept-Encoding ""; sub_filter ''; } 上面是nginx的配置
proxy_hide_header "X-Frame-Options"; 去掉response中的X-Frame-Options,让页面可以让Iframe加载
sub_filter ''; 将页面中的""字符串替换成, 作用是让该页面以引入的xxx.com的资源别再发给nginx了,直接去http://www.xxx.com/去获取
proxy_set_header Accept-Encoding ""; 让www.xxx.com那边别以gzip的方式给nginx传页面,该句为sub_filter 服务,gzip压缩的页面sub_filter无法识别和处理 |
CopyRight 2018-2019 实验室设备网 版权所有 |